package com.idp.system.dto;

import com.idp.common.enums.UserTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 用户DTO类
 * @author king
 */
@Data
@ApiModel(description = "用户DTO类")
public class SysUserDto implements Serializable {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty("主键ID")
	private String id;
	@ApiModelProperty("用户账号")
	private String uname;
	@ApiModelProperty("用户密码")
	private String pwd;
	@ApiModelProperty("姓名")
	private String fullName;
	@ApiModelProperty("电话")
	private String phone;
	@ApiModelProperty("邮箱")
	private String email;
	@ApiModelProperty("描述")
	private String description;
	@ApiModelProperty("用户头像")
	private String userPhoto;
	@ApiModelProperty("用户类型")
	private String userType;
	@ApiModelProperty("角色ids")
	private List<String> roleIds;
	@ApiModelProperty("角色")
	private String roleNames;

	@ApiModelProperty("是否超级管理员")
	public Boolean isAdmin() {

		return UserTypeEnum.ADMIN.code.equals(this.userType);
	}
}
